package leaveSystem.model;

import java.io.Serializable;


public class LeaveType implements Cloneable, Serializable {

    private int leaveTypeId;
    private String leaveTypeName;
    private String leaveDescription;
    private String createdBy;


    public LeaveType () {

    }

    public LeaveType (int leaveTypeIdIn) {

          this.leaveTypeId = leaveTypeIdIn;

    }

    public int getLeaveTypeId() {
          return this.leaveTypeId;
    }
    public void setLeaveTypeId(int leaveTypeIdIn) {
          this.leaveTypeId = leaveTypeIdIn;
    }

    public String getLeaveTypeName() {
          return this.leaveTypeName;
    }
    public void setLeaveTypeName(String leaveTypeNameIn) {
          this.leaveTypeName = leaveTypeNameIn;
    }

    public String getLeaveDescription() {
          return this.leaveDescription;
    }
    public void setLeaveDescription(String leaveDescriptionIn) {
          this.leaveDescription = leaveDescriptionIn;
    }

    public String getCreatedBy() {
          return this.createdBy;
    }
    public void setCreatedBy(String createdByIn) {
          this.createdBy = createdByIn;
    }

    public void setAll(int leaveTypeIdIn,
          String leaveTypeNameIn,
          String leaveDescriptionIn,
          String createdByIn) {
          this.leaveTypeId = leaveTypeIdIn;
          this.leaveTypeName = leaveTypeNameIn;
          this.leaveDescription = leaveDescriptionIn;
          this.createdBy = createdByIn;
    }

    public boolean hasEqualMapping(LeaveType valueObject) {

          if (valueObject.getLeaveTypeId() != this.leaveTypeId) {
                    return(false);
          }
          if (this.leaveTypeName == null) {
                    if (valueObject.getLeaveTypeName() != null)
                           return(false);
          } else if (!this.leaveTypeName.equals(valueObject.getLeaveTypeName())) {
                    return(false);
          }
          if (this.leaveDescription == null) {
                    if (valueObject.getLeaveDescription() != null)
                           return(false);
          } else if (!this.leaveDescription.equals(valueObject.getLeaveDescription())) {
                    return(false);
          }
          if (this.createdBy == null) {
                    if (valueObject.getCreatedBy() != null)
                           return(false);
          } else if (!this.createdBy.equals(valueObject.getCreatedBy())) {
                    return(false);
          }

          return true;
    }


    public String toString() {
        StringBuffer out = new StringBuffer("");
        out.append("\nclass LeaveType, mapping to table leave_type\n");
        out.append("Persistent attributes: \n"); 
        out.append("leaveTypeId = " + this.leaveTypeId + "\n"); 
        out.append("leaveTypeName = " + this.leaveTypeName + "\n"); 
        out.append("leaveDescription = " + this.leaveDescription + "\n"); 
        out.append("createdBy = " + this.createdBy + "\n"); 
        return out.toString();
    }

    public Object clone() {
        LeaveType cloned = new LeaveType();

        cloned.setLeaveTypeId(this.leaveTypeId); 
        if (this.leaveTypeName != null)
             cloned.setLeaveTypeName(new String(this.leaveTypeName)); 
        if (this.leaveDescription != null)
             cloned.setLeaveDescription(new String(this.leaveDescription)); 
        if (this.createdBy != null)
             cloned.setCreatedBy(new String(this.createdBy)); 
        return cloned;
    }


}

